package  
{
	import flash.display.Sprite;
	import flash.display.Stage;
	import flash.events.MouseEvent;
	import flash.geom.Matrix;
	/**
	 * ...
	 * @author Joseph Waters
	 */
	public class GameGraphics extends Sprite
	{
		private var parentSprite:Sprite = new Sprite();
		private var stageSprite:Sprite;
		private var starField:Stars = new Stars(1000);
		public var planetArray:Array = new Array(); // Array for planet objects
		
		public function GameGraphics(stageSpr:Sprite) 
		{
			stageSprite = stageSpr;
		}
		
		public function init():void {
			// Add a star field in the background
			parentSprite.addChild(starField);
			
			// Add some random planets for testing
			for (var j:int = 0; j < 10; j++) {	
				planetArray.push(new Planet(600, 480, 10));
				
				parentSprite.addChild(planetArray[j]);
			}
		}		
		
		public function update():void {
			if(stageSprite.numChildren > 0) {
				stageSprite.removeChild(parentSprite);
			}
			stageSprite.addChild(parentSprite);
		}
	}

}